projects
/
project
/
fstools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc6a462
)
block: validate amount of arguments for the "autofs" command
author
Rafał Miłecki
<
[email protected]
>
Sun, 9 Dec 2018 13:22:17 +0000
(14:22 +0100)
committer
Rafał Miłecki
<
[email protected]
>
Sun, 9 Dec 2018 13:22:17 +0000
(14:22 +0100)
Using argv[3] without checking argc value could result in undefined
behavior. It could result in a crash or accessing a NULL that separates
argv from envp on UNIX.
Signed-off-by: Rafał Miłecki <
[email protected]
>
Acked-by: John Crispin <
[email protected]
>
block.c
patch
|
blob
|
history
diff --git
a/block.c
b/block.c
index 46050b4f3f7c38fde1933ad4478ea183abd0c46b..a0bbf47aa780a865be1db96dc242564244f040c3 100644
(file)
--- a/
block.c
+++ b/
block.c
@@
-1157,6
+1157,10
@@
static int main_autofs(int argc, char **argv)
}
return 0;
}
+
+ if (argc < 4)
+ return -EINVAL;
+
return mount_action(argv[2], argv[3], TYPE_AUTOFS);
}